package com.fulihui.weixinclient.request.order;

import com.fulihui.weixinclient.http.HttpMethodEnum;
import com.fulihui.weixinclient.result.order.OrderQueryWeixinResult;
import com.fulihui.weixinclient.util.XMLUtil;

/**
 * 查询订单接口查询参数
 * Created by Willard on 2015/9/17.
 */
public class OrderQueryWeixinRequest extends OrderWeixinRequest<OrderQueryWeixinResult> {
    private static final long serialVersionUID = -6771906927534569975L;

    /* 微信订单号 与out_trade_no二选一必填 */
    private String            transaction_id;

    /* 商户订单号 与transaction_id二选一必填 */
    private String            out_trade_no;

    @Override
    protected void childParam() {
    }

    @Override
    public String service() {
        return "https://api.mch.weixin.qq.com/pay/orderquery";
    }

    @Override
    public String urlEndStr() {
        return null;
    }

    @Override
    public OrderQueryWeixinResult parseResult(String respStr) {
        return XMLUtil.parseObject(respStr, OrderQueryWeixinResult.class);
    }

    @Override
    public HttpMethodEnum httpMethod() {
        return HttpMethodEnum.SSL_POST;
    }

    @Override
    public String requestData() {
        return XMLUtil.toXMLString(this);
    }

    public String getAppid() {
        return appid;
    }

    @Override
    public void setAppid(String appid) {
        this.appid = appid;
    }

    public String getMch_id() {
        return mch_id;
    }

    public void setMch_id(String mch_id) {
        this.mch_id = mch_id;
    }

    public String getTransaction_id() {
        return transaction_id;
    }

    public void setTransaction_id(String transaction_id) {
        this.transaction_id = transaction_id;
    }

    public String getOut_trade_no() {
        return out_trade_no;
    }

    public void setOut_trade_no(String out_trade_no) {
        this.out_trade_no = out_trade_no;
    }

    public String getNonce_str() {
        return nonce_str;
    }

    public void setNonce_str(String nonce_str) {
        this.nonce_str = nonce_str;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }
}
